﻿namespace CleanLite.Domain.Models
{
    public class ApiResponse<T>(bool success, string message, T data)
    {
        public bool Success { get; set; } = success;
        public string Message { get; set; } = message;
        public T Data { get; set; } = data;

        public static ApiResponse<T> SuccessResponse(T data = default, string message = "操作成功")
        {
            return new ApiResponse<T>(true, message, data);
        }

        public static ApiResponse<T> FailResponse(T data = default, string message = "操作失败")
        {
            return new ApiResponse<T>(false, message, data);
        }
    }

    public class ApiResponse(bool success, string message)
    {
        public bool Success { get; set; } = success;
        public string Message { get; set; } = message;

        public static ApiResponse SuccessResponse(string message = "操作成功")
        {
            return new ApiResponse(true, message);
        }

        public static ApiResponse FailResponse(string message = "操作失败")
        {
            return new ApiResponse(false, message);
        }
    }
}